using System;
using System.Collections.Generic;
using System.Text;

using NHibernate;
using NHibernate.Data.Models;
using NHibernate.Data.Base;

namespace NHibernate.Data.Managers
{
    public partial interface IWineryManager : IManagerBase<Winery, long>
    {
		// Get Methods
		IList<Winery> GetByAddress(System.Int64 address);
		IList<Winery> GetByClassification(System.Int64 classification);
		IList<Winery> GetByCorporation(System.Int64 corporation);
		IList<Winery> GetByIntroduction(System.Int64 introduction);
		IList<Winery> GetByLocalName(System.Int64 localName);
		IList<Winery> GetByWeather(System.Int64 weather);
    }

    partial class WineryManager : ManagerBase<Winery, long>, IWineryManager
    {
		#region Constructors
		
		public WineryManager() : base()
        {
        }
        public WineryManager(INHibernateSession session) : base(session)
        {
        }
		
		#endregion
		
        #region Get Methods

		
		public IList<Winery> GetByAddress(System.Int64 address)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Winery));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("address", address));
			
			return criteria.List<Winery>();
        }
		
		public IList<Winery> GetByClassification(System.Int64 classification)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Winery));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("Classification", classification));
			
			return criteria.List<Winery>();
        }
		
		public IList<Winery> GetByCorporation(System.Int64 corporation)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Winery));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("Corporation", corporation));
			
			return criteria.List<Winery>();
        }
		
		public IList<Winery> GetByIntroduction(System.Int64 introduction)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Winery));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("Introduction", introduction));
			
			return criteria.List<Winery>();
        }
		
		public IList<Winery> GetByLocalName(System.Int64 localName)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Winery));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("LocalName", localName));
			
			return criteria.List<Winery>();
        }
		
		public IList<Winery> GetByWeather(System.Int64 weather)
        {
            ICriteria criteria = Session.GetISession().CreateCriteria(typeof(Winery));
			
			criteria.Add(NHibernate.Criterion.Expression.Eq("Weather", weather));
			
			return criteria.List<Winery>();
        }
		
		#endregion
    }
}